doctype html
html(lang=language)
  head
    title #{title}
    meta(charset='utf-8')
    meta(name='description', content=description)
    meta(name='viewport', content='width=device-width, initial-scale=1')
    link(rel='shortcut icon' href='/' + pathPrefix + 'favicon.ico?v=2')

    - if (language === baseLanguage)
      link(rel='stylesheet', href='style/garden.css', media='all')
      link(rel='stylesheet', href='style/print.css', media='print')

    - else
      link(rel='stylesheet', href='../style/garden.css', media='all')
      link(rel='stylesheet', href='../style/print.css', media='print')

    <!--[if lt IE 9]>
    <script src="javascript/html5.js"></script>
    <![endif]-->

  body

    // Navigation
    nav(id='nav_main')
      div
        ul
          - each lang in languages
            li(class=lang.id === language ? 'active' : '')
              - if (lang.id === baseLanguage)
                a(href= '/' + pathPrefix, title=lang.title) #{lang.id}

              - else
                a(href= '/' + pathPrefix + lang.id, title=lang.title) #{lang.id}
        a(id='top', href='#intro', title='Back to top') #top
        a(id='hide_menu', class='tablet') Hide Menu

      ul
        - each section in navigation
          li(class='nav_' + section.link.replace(/\./g, '_'))
            h1
              a(href='#' + section.link) #{section.title}

            ul
                - if (section.articles.length > 0 && !section.isIntro)
                    - each article in section.articles
                      li
                        a(href='#' + article.link)!=article.title

    // Mobile navigation
    nav(id='nav_mobile')
      a(id='nav_prev_section', href='#') prev section
        span(class='nav_section_name') section name

      a(id='nav_next_section', href='#') next section
        span(class='nav_section_name') section name

      a(id='show_menu') show menu

    // Sections
    - each section in sections
      section(id=section.link)

        // Introduction
        header(id=section.link + '.intro')
          h1 #{section.title}
          - if (section.index)
            div!=section.index.text

        // Articles
        - each article in section.articles
          article(id=article.link)
            h2!=article.title

            - each sub in article.subs
              div!=sub

    // Footer
    footer
      p Copyright &copy;. Built with
        |
        a(href='http://nodejs.org/')  Node.js
        |  using a
        a(href='https://github.com/visionmedia/jade/')  jade
        |  template.

    script(src='//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js')

    - if (language === baseLanguage)
      script(src='javascript/prettify.js')
      script(src='javascript/garden.js')

    - else
      script(src='../javascript/prettify.js')
      script(src='../javascript/garden.js')
